﻿<UserControl x:Class="Silverlight.Arcgis.MapTip.GraphicMapTip"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"
    xmlns:esriConverters="clr-namespace:ESRI.ArcGIS.Client.ValueConverters;assembly=ESRI.ArcGIS.Client"
    xmlns:esriSymbols="clr-namespace:ESRI.ArcGIS.Client.Symbols;assembly=ESRI.ArcGIS.Client">
    <Grid x:Name="LayoutRoot">

        <Grid.Resources>
            <esriConverters:DictionaryConverter x:Name="MyDictionaryConverter" />
            <esriSymbols:SimpleFillSymbol x:Name="DefaultFillSymbol" Fill="#01FFFFFF" BorderBrush="#88000000" BorderThickness="2" />
        </Grid.Resources>

        <esri:Map x:Name="MyMap" Background="White" Extent="-130,10,-70,60">
            <esri:Map.Layers>

                <esri:ArcGISDynamicMapServiceLayer ID="BaseMapLayer"
                        Url="{StaticResource MapUrl}" />

                <esri:GraphicsLayer ID="MyGraphicsLayer" Initialized="MyGraphics_Initialized">
                    <esri:GraphicsLayer.MapTip>
                        <Grid>
                            <Rectangle RadiusX="10" RadiusY="10" Fill="#44000000" Margin="10,10,-10,-10" />
                            <Rectangle RadiusX="5" RadiusY="5" Margin="3" >
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="1.038,1.136" StartPoint="0.015,0.188">
                                        <GradientStop Color="#FFD1DFF2"/>
                                        <GradientStop Color="#FF092959" Offset="0.946"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Border CornerRadius="10" BorderBrush="#FF222957" BorderThickness="3" />
                            <StackPanel Orientation="Vertical" Margin="20,15,20,15">
                                <StackPanel Orientation="Horizontal" Margin="0,0,0,6">
                                    <TextBlock Text="State Name: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" />
                                    <TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, 
                                        ConverterParameter=STATE_NAME, Mode=OneWay}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="Population 2007: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" />
                                    <TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, 
                                        ConverterParameter=POP2007, Mode=OneWay}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" />
                                </StackPanel>
                            </StackPanel>
                        </Grid>
                    </esri:GraphicsLayer.MapTip>
                </esri:GraphicsLayer>

            </esri:Map.Layers>
        </esri:Map>

        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" >
            <Rectangle Fill="#22000000" RadiusX="10" RadiusY="10" Margin="0,4,0,0" />
            <Rectangle Fill="#775C90B2" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5" />
            <Rectangle Fill="#DDFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
            <TextBlock Text="Hover over a state to see the GraphicsLayer MapTip." TextAlignment="Center" Margin="25,25,25,25" />
        </Grid>

    </Grid>
</UserControl>
